﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

#nullable disable

namespace T4.Console.Db.Models
{
    [Table("Blog_Info")]
    [Index(nameof(Author), Name = "Index_1")]
    public partial class Blog_Info
    {
        public Blog_Info()
        {
            Blog_Collects = new HashSet<Blog_Collect>();
            Blog_Comments = new HashSet<Blog_Comment>();
            Blog_PersonCategory_Maps = new HashSet<Blog_PersonCategory_Map>();
            Blog_PersonLabel_Maps = new HashSet<Blog_PersonLabel_Map>();
        }

        [Key]
        [StringLength(36)]
        public string Id { get; set; }
        [Required]
        [StringLength(36)]
        public string Author { get; set; }
        public int Category { get; set; }
        [Required]
        [StringLength(200)]
        public string Title { get; set; }
        [Required]
        [Column(TypeName = "ntext")]
        public string Content { get; set; }
        public bool? IsPublish { get; set; }
        public bool? AllowComment { get; set; }
        public bool? IsTop { get; set; }
        public int? WhoVisit { get; set; }
        public bool? IsDel { get; set; }
        [Column(TypeName = "datetime")]
        public DateTime? TopTime { get; set; }
        [Column(TypeName = "datetime")]
        public DateTime? DelTime { get; set; }
        [StringLength(36)]
        public string CreatedBy { get; set; }
        [Column(TypeName = "datetime")]
        public DateTime? CreatedTime { get; set; }
        [StringLength(36)]
        public string LastModifiedBy { get; set; }
        [Column(TypeName = "datetime")]
        public DateTime? LastModifiedTime { get; set; }

        [ForeignKey(nameof(Author))]
        [InverseProperty(nameof(Sys_User.Blog_Infos))]
        public virtual Sys_User AuthorNavigation { get; set; }
        [InverseProperty("Blog")]
        public virtual Blog_Interest Blog_Interest { get; set; }
        [InverseProperty(nameof(Blog_Collect.Blog))]
        public virtual ICollection<Blog_Collect> Blog_Collects { get; set; }
        [InverseProperty(nameof(Blog_Comment.Blog))]
        public virtual ICollection<Blog_Comment> Blog_Comments { get; set; }
        [InverseProperty(nameof(Blog_PersonCategory_Map.Blog))]
        public virtual ICollection<Blog_PersonCategory_Map> Blog_PersonCategory_Maps { get; set; }
        [InverseProperty(nameof(Blog_PersonLabel_Map.Blog))]
        public virtual ICollection<Blog_PersonLabel_Map> Blog_PersonLabel_Maps { get; set; }
    }
}
